<?php
include_once 'inc/config.inc.php';
include "inc/mysql.inc.php";
$template['title'] = '学生信息管理';
?>

		<?php include"include/header.php" ?>
			

			<div id="content" class="span10">
			
			
			<ul class="breadcrumb">
				<li>
					<i class="icon-home"></i>
					<a href="index.php">Home</a>
					<i class="icon-angle-right"></i>
				</li>
				<li><a href="#">学生信息管理</a></li>
			</ul>
                <h2>请输入将进行管理的学生学号</h2>
                <form action="widgets.php" method="post">
                    学号：<input type="text" name="keys" value="<?php echo $_POST['keys']?>">
                    <input type="submit" name="sub" value="点击查询">
                </form>
<?php 

$link = connect();
if(!empty($_POST['sub'])){

$sql2 = "select * from student where sid={$_POST['keys']} ";
$rs2=execute($link,$sql2);
while ($row2=mysqli_fetch_assoc($rs2)) {

?>

                   <table width="800" border="2"  class="animated fadeInUpBig">
                    <tr>
                        <th>学号</th>
                        <th>姓名</th>
                        <th>年龄</th>
                        <th>专业</th>
                        <th>联系方式</th>
                        <th>楼栋</th>
                        <th>宿舍</th>
                        <th>操作</th>
                    </tr>


                        <tr>
                            <td align="center"><?php echo $row2['sid'] ?></td>
                            <td align="center"><?php echo $row2['name'] ?></td>
                            <td align="center"><?php echo $row2['age'] ?></td>
                            <td align="center"><?php echo $row2['professional'] ?></td>
                            <td align="center"><?php echo $row2['phone'] ?></td>
                            <td align="center"><?php echo $row2['ldh'] ?></td>
                            <td align="center"><?php echo $row2['ssh'] ?></td>
                            <td align="center"><a href="delete.php?id=<?php echo $row2['sid'] ?>">删除</a> <a href="edit.php?id=<?php echo $row2['sid'] ?>">修改</a> </td>

                        </tr>
                        <?php  } ?>

<?php  } ?>
</table><br><br>

                <table width="800" border="2"   class="animated fadeInUpBig">
                    <tr>
                        <th>学号</th>
                        <th>姓名</th>
                        <th>年龄</th>
                        <th>专业</th>
                        <th>联系方式</th>
                        <th>楼栋</th>
                        <th>宿舍</th>
                        <th>操作</th>
                    </tr>

<?php 
$link = connect();
$sql1 = 'select * from student';
$rs=execute($link,$sql1);

while ($row=mysqli_fetch_assoc($rs)) {

?>
                        <tr>
                            <td align="center"><?php echo $row['sid'] ?></td>
                            <td align="center"><?php echo $row['name'] ?></td>
                            <td align="center"><?php echo $row['age'] ?></td>
                            <td align="center"><?php echo $row['professional'] ?></td>
                            <td align="center"><?php echo $row['phone'] ?></td>
                            <td align="center"><?php echo $row['ldh'] ?></td>
                            <td align="center"><?php echo $row['ssh'] ?></td>
                            <td align="center"><a href="delete.php?id=<?php echo $row['sid'] ?>">删除</a> <a href="edit.php?id=<?php echo $row['sid'] ?>">修改</a> </td>

                        </tr>
						
       <?php } ?>
    
                </table>
				<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
	
</body>
</html>